<template>
    <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="登录账号">
                <el-input v-model="formInline.user" placeholder="请输入账户"></el-input>
            </el-form-item>
            <el-form-item label="登录密码">
                <el-input v-model="formInline.pwd"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="login">登录</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import axios from '../http/http'
    export default {
        name: "login",
        data(){
            return{
                formInline:{
                    user:'',
                    pwd:''
                }
            }
        },
        methods:{
            login(){
                axios({
                    url:'/login',
                    method:'post',
                    data:{
                        "zhangHuMiMa": this.formInline.pwd,
                        "zhangHuMingCheng": this.formInline.user,
                    }
                }).then(res=>{
                    this.$router.push('/home')
                })
            }
        }
    }
</script>

<style scoped>

</style>